package com.boarsoft.boar.demo.product.biz;

import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.boarsoft.boar.demo.product.entity.PocProduct;
import com.boarsoft.hibernate.biz.SimpleBizImpl;

@Component("productBiz")
public class PocProductBizImpl extends SimpleBizImpl implements PocProductBiz {

	@Override
	@Transactional
	public boolean add(PocProduct product) {
		if (dao.save(product) == null) {
			return false;
		}
		return true;
	}

	@Override
	@Transactional
	public boolean update(PocProduct product) {
		return dao.update(product);
	}

	@Override
	@Transactional(readOnly = true)
	public PocProduct get(int id) {
		return dao.get(PocProduct.class, id);
	}
}
